import Http from "@/utils/request";

export const addOrder = (data: AddOrder) => Http.post<BaseResponse<string>, AddOrder>({ url: "/order/add", data });

export const orderList = () => Http.get<BaseResponse<OrderList[]>>({ url: "/order/list" })

export const completeOrder = (orderId: number) => Http.post<BaseResponse<string>, number>({ url: "/order/complete?", params: { orderId } })

export const orderListInPending = () => Http.get<BaseResponse<OrderList[]>>({ url: "/order/pendingOrder" })

export const orderListInProgress = () => Http.get<BaseResponse<OrderList[]>>({ url: "/order/progressOrder" })

export const orderReback = (orderId: number) => Http.post<BaseResponse<string>, number>({ url: `/order/reback/${orderId}` });

export const employeeOrderList = () => Http.get<BaseResponse<EmployeeOrderType[]>>({ url: "/order/employee/orderList" });

export const progressOrder = (orderId: number) => Http.post<BaseResponse<string>, number>({ url: "/order/employee/progressOrder?", params: { orderId } });

export const searchOrderByDate = (startDate: string, endDate: string) => Http.get<BaseResponse<EmployeeOrderType[]>, { startDate: string, endDate: string }>({
    url: "/order/employee/orderListByDate?", params: {
        startDate,
        endDate
    }
});